<template>
  <div class="page-index">
    <el-row>
      <el-col :span="5">
        <emenu />
      </el-col>
      <el-col :span="19">
        <life :advertiseList="advertiseList" />
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <artistic />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Emenu from "@/components/index/menu.vue";
import Life from "@/components/index/life.vue";
import Artistic from "@/components/index/artistic.vue";
import { getHomeContent } from "@/api/index";
export default {
  components: {
    Emenu,
    Life,
    Artistic
  },
  data() {
    return {
      advertiseList: [],
      hotProductList: [],
      newProductList: []
    };
  },
  created() {
    this.getHomeContent();
  },
  methods: {
    async getHomeContent() {
      let res = await getHomeContent();
      try {
        if (res.code === 200) {
          const { advertiseList, hotProductList, newProductList } =
            res.data || {};
          this.advertiseList = advertiseList;
          this.hotProductList = hotProductList;
          this.newProductList = newProductList;
        }
      } catch (err) {
        console.log(err);
      }
    }
  }
};
</script>

<style lang="scss">
@import "@/assets/css/index/index.scss";
</style>
